package com.dnb.webmash.playmaker.client.mediaplayer;

public enum MediaPlayerState {//TODO this should list the common default media states and also have a way of determining unique states depending on MediaType
	UNSTARTED(-1), ENDED(0), PLAYING(1), PAUSED(2), BUFFERING(3), CUED(5);//TODO need state for notworking?
	//TODO INCOMPLETE, NOT IN USE
	private int value;
	
	MediaPlayerState(int value) {
		this.value = value;
	}
	
	public int getValue() {
		return value;
	}
	
	public static MediaPlayerState get(int state) {
		for (MediaPlayerState mediaState : MediaPlayerState.values()) {
			if (mediaState.getValue() == state) {
				return mediaState;
			}
		}
		
		return null;
	}
}